<?php
defined('_JEXEC') or die( 'Restricted access' );

class JElementIprofile extends JElement
{
	var	$_name = 'IProfile';

	function fetchElement($name, $value, &$node, $control_name)
	{
		$db =& JFactory::getDBO();
	    $query = "SELECT id as value, name as text FROM #__igallery_profiles WHERE published = 1 ORDER BY ordering";
	    $db->setQuery( $query );
	    $profiles = $db->loadObjectList();
		
	    $selectHTML = JHTML::_("select.genericlist", $profiles, $control_name.'['.$name.']', 'class="inputbox"', 'value', 'text',
	    $value, $control_name.$name );
	
	    return $selectHTML;
	}
}
?>